package ai.remi.boot.server.service.impl;

import ai.remi.boot.domain.entity.User;
import ai.remi.boot.domain.tree.MenuTree;
import ai.remi.boot.domain.vo.UserVO;
import ai.remi.boot.infra.mapper.UserMapper;
import ai.remi.boot.server.service.*;
import ai.remi.comm.domain.tree.TreeBuild;
import ai.remi.comm.util.bean.BeanCopyUtils;
import ai.remi.comm.util.collection.CollectionUtils;
import ai.remi.comm.util.object.ObjectUtils;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.h2.engine.Role;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author DianJiu
 * @email dianjiuxyz@gmail.com
 * @desc 用户表(User)服务实现层
 */
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public UserVO getUserById(String id) {
        UserVO userVO = userMapper.selectOneById(id);
        // 获取用户角色
        //List<RoleVO> userRoles = getUserRoles(id);
        //userVO.setUserRoles(userRoles);
        // 获取用户菜单
        //List<AppMenuVO> userMenus = getUserMenus(userRoles);
        //userVO.setUserMenus(userMenus);
        return userVO;
    }
}

